package com.h3c.ptability.client;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "sap", url = "${pm.sap.url}")
public interface SapClient {

    @PostMapping(value = "/api/ExCommon/GetAppToken", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
    JSONObject getToken(@RequestBody String str);

    @PostMapping(value = "/api/ExCommon/GetZfmEhrGetZhrtxzkdFromSapToHRSSC", consumes = {"application/json"}, headers = {"API-TOKEN={API-TOKEN}"})
    JSONObject getJobSalaryInfo(@RequestBody String str, @RequestParam("API-TOKEN") String token);



    @PostMapping(value = "/api/ExCommon/GetZfmEhrGetTstxFromSapToHRSSC", consumes = {"application/json"}, headers = {"API-TOKEN={API-TOKEN}"})
    JSONObject getWorekrInfoAbroad(@RequestBody String str, @RequestParam("API-TOKEN") String token);

    @PostMapping(value = "/api/ExCommon/GetZfmEhrTstxDlFromSapToHRSSC", consumes = {"application/json"}, headers = {"API-TOKEN={API-TOKEN}"})
    JSONObject getWorekrInfo(@RequestBody String str, @RequestParam("API-TOKEN") String token);

    /**
     * HC_NO ConfirmEntryDate ConfirmHRBP
     * @param str
     * @param token
     * @return {
     *     "data": null,
     *     "success": true,
     *     "message": "受理成功",
     *     "code": 1, 1-成功 2-失败
     *     "expiryDate": null
     * }
     */
    @PostMapping(value = "/api/ExCommon/ConfirmEntryDate", consumes = {"application/json"}, headers = {"API-TOKEN={API-TOKEN}"})
    JSONObject ConfirmEntryDate(@RequestBody String str, @RequestParam("API-TOKEN") String token);

    @GetMapping(value = "/api/ExCommon/GetAppSecret", consumes = {"application/json"})
    JSONObject getAppSecret(@RequestParam("appId")String appId, @RequestParam("curSecret") String curSecret);

    @GetMapping(value = "/api/ExCommon/GetSapDataItems", consumes = {"application/json"}, headers = {"API-TOKEN={API-TOKEN}"})
    JSONObject getSapDataItems(@RequestParam("API-TOKEN") String token);

}
